package com.kfm.pm;

import java.util.Random;

public class Exec04 {

    public static void main(String[] args) {
        // 设计一个方法，用于计算1-100的和
        System.out.println(sum(1000));
    }
    public static int sum(int num) {
        int sum = 0;
        for (int i = 1; i <= num; i++) {
            sum += i;
        }
        return sum;
    }
}
